package com.example.manualexchangemultipledatasourcedemo.controller;

import com.example.manualexchangemultipledatasourcedemo.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yj
 * @since 2020/9/14
 */

@RestController
@RequestMapping("/")
public class ManualExchangeDataSourceController {

    private final ConsumerService consumerService;

    @Autowired
    public ManualExchangeDataSourceController(ConsumerService consumerService) {
        this.consumerService = consumerService;
    }

    @GetMapping("")
    public String doTest() {
        consumerService.AddAndRemoveData();
        return "Hello,World";
    }
}
